﻿#region Header

/*
Behavioral Rating of Dancing Human Crowds based on Motion Patterns
By

Pascal Hauser 
Dipl. Ing. in Informatik, Hochschule für Technik Rapperswil, 2006
Master Thesis, Hochschule für Technik Rapperswil, 2008-2010

and

Raphael Gfeller
Dipl. Ing. in Informatik, Hochschule für Technik Rapperswil, 2006
Master Thesis, Hochschule für Technik Rapperswil, 2008-2010

*/

#endregion

#region Usings

using System;
using System.Threading;
using paravili.Services;
using Sebarf.Services.Interfaces;

#endregion

namespace paravili.Steps {
	/// <summary>
	/// notifies all image data displayer that the images has been changed
	/// </summary>
	public class NotifyImageDataDisplayer : ProcessStepWithMeasurement<Object> {
		#region Public Properties

		[ServiceRequest(IsOptional = true)]
		public IImageLocatorService ImageLocatorService { get; set; }

		[ServiceRequest(IsOptional = true)]
		public IDispatcherLocatorService DispatcherLocatorService { get; set; }

		#endregion

		#region Public Methods

		protected override object OnProcess(object toProcess) {
			DispatcherLocatorService.GetDispatcher().Invoke(new ThreadStart(delegate {
				foreach (
					ImageEntry img in ImageLocatorService.Images) {
					img.Refresh();
				}
			}), null);

			return toProcess;
		}

		#endregion
	}
}